<template>
    <h3>登录表单</h3>
    <el-form :model="form" label-width="80px" label-position="left" inline>
        <el-form-item label="用户名">
            <el-input type="text" placeholder="请输入用户名" v-model="form.username" />
        </el-form-item>
        <el-form-item label="密码">
            <el-input type="password" placeholder="请输入密码" v-model="form.password" />
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="submit">提交</el-button>
            <el-button >重置</el-button>
        </el-form-item>
    </el-form>
</template>

<script setup>
import { reactive } from 'vue';
const form = reactive({
    username: '',
    password: ''
})
const submit = () => {
    console.log(form); 
    if(form.username === 'admin' && form.password === '123456') {
        console.log('登录成功')
    }else {
        console.log('登录失败')
    }
    // 提交表单数据、登录
}
</script>

<style></style>